GetData Method

The GetData procedure method allows you to programatically retrieve data arguments for an IDL graphic after it has been created.

The arguments to the GetData method should be specified in the same manner as the function call used to create the graphic. You may not get the value of non-data arguments or properties.

Coordinate Systems

For the Arrow, Polygon, Polyline, and Symbol graphics, if the graphic is created in data coordinates (with the DATA keyword), the coordinates are returned in data coordinates. If the graphic is created in device coordinates (with the DEVICE keyword) or normalized coordinates (with the NORMAL keyword, the default value for creation), the coordinates are returned in normalized coordinates. The ConvertCoord Method may be used to convert values from one coordinate system to another.

Automatic Gridding

For the Image, Contour, and Surface graphics, if the original data was automatically gridded, then GetData will return the data on the regular grid, not the original data.

Example

PRECIP=[0.5,0.7,1.2,1.8,2.5,1.6,1.9]

DAY=[7, 8, 9, 10, 11, 12, 13]

 

; Display the first plot to display the precipitation data.

p1 = PLOT(DAY, PRECIP, 'r-:2', $

TITLE = 'Denver Precipitation', $

YTITLE = 'Inches', XTITLE= 'June Date')

 

p1.GetData, date, rain

PRINT, 'Rain on June 10', rain[3]

Syntax

graphic.GetData, Argument1, Argument2, ... Argumentn  [, BOTTOM_VALUES=value] [, CONNECTIVITY=value]

Arguments

The output arguments depend on the graphic being queried and the number of arguments supplied. The form of the arguments is similar to the arguments supplied for the creation of the graphic.

The following table lists the form of return arguments for the IDL graphics functions that support the GetData method.

Graphic

1 Arg

2 Args

3 Args

4 Args

Keywords

Coordinates


Arrow

 

X, Y

 

 

 

NORMAL unless created with /DATA


Barplot

Y

X, Y

 

 

BOTTOM_VALUES

DATA


Boxplot

Values

Locations, Values

 

 

 

DATA

Bubbleplot

 

X, Y

 

 

 

DATA


Contour

Z

 

Z, X, Y

 

 

DATA


Errorplot

 

Y, Yerror

X, Y, Yerror

X, Y, Xerror, Yerror

 

DATA

Fillplot

Y

X, Y

 

 

 

DATA


Image

Image

 

Image, X, Y

 

 

DATA


Plot3D

 

 

X, Y, Z

 

 

DATA


Plot

Y

X, Y

 

 

 

DATA


Polarplot

Theta

R, Theta

 

 

 

DATA


Polygon

 

X, Y

X, Y, Z

 

CONNECTIVITY

NORMAL unless created with /DATA


Polyline

 

X, Y

X, Y, Z

 

CONNECTIVITY

NORMAL unless created with /DATA

Scatterplot

 

X, Y

 

 

 

DATA

Scatterplot3D

 

 

X, Y, Z

 

 

DATA


Streamline

 

U, V

 

U, V, X, Y

 

DATA


Surface

Z

 

Z, X, Y

 

 

DATA


Symbol

 

X, Y

 

 

 

NORMAL unless created with /DATA


Vector

 

U, V

 

U, V, X, Y

 

DATA

Volume

Vol0

Vol0, Vol1

 

Vol0, Vol1, Vol2, Vol3

 

DATA

Keywords

BOTTOM_VALUES

This keyword applies only to the Barplot graphic, and allows you to retrieve the BOTTOM_VALUES data.

CONNECTIVITY

This keyword applies only to POLYLINE and POLYGON graphics, and allows you to retrieve the CONNECTIVITY data.

Version History

8.1

Introduced

See Also

Save Method, Refresh Method, SetData Method